-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viper data collection changes #751
base: master
Are you sure you want to change the base?
Conversation
@@ -765,6 +771,13 @@ class ScallopGobraConfig(arguments: Seq[String], isInputOptional: Boolean = fals | |||
default = Some(ConfigDefaults.DefaultDisableSetAxiomatization), | |||
noshort = true, | |||
) | |||
|
|||
val submitForEvaluation = opt[Boolean](name = "submitForEvaluation", | |||
descr = "Whether to allow storing the current program for future evaluation.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
descr = "Whether to allow storing the current program for future evaluation.", | |
descr = "Upload the verified program to Gobra's servers. This information will be used to improve Gobra.", |
(I think there is already a variable for the tool name, we can use that directly instead of hardcoding "Gobra")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a sentence saying that we collect only the program and no other information would also be important.
case CarbonBackend => "Carbon" | ||
case SiliconBackend => "Silicon" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not exhaustive. What if we have a viper server with silicon or carbon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, we should extend the trait ViperBackend
with an extra method or field of type string named name
and use it instead, instead of matching on all available ones.
@@ -51,6 +56,8 @@ object GoVerifier { | |||
|
|||
trait GoVerifier extends StrictLogging { | |||
|
|||
protected var submitters: Map[String, ManualProgramSubmitter] = Map() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some documentation on this? what is the purpose of this field? what are the keys and the values?
@@ -275,6 +279,7 @@ case class BaseConfig(gobraDirectory: Path = ConfigDefaults.DefaultGobraDirector | |||
case _ => Some(positions.toVector) | |||
} | |||
} | |||
def allowSubmission: Boolean = submitForEvaluation && !shouldChop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't we submit chopped programs?
val timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss"); | ||
config.packageInfoInputMap.keys.foreach(pkgInfo => { | ||
val pkgId = pkgInfo.id | ||
|
||
//adds a submitter for this package to submitters if config.submitForEvaluation is set, key is pkgId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like the wrong place for this comment. Sth like this should be in createSubmitter
and and the description of what we store in keys/values should be on the declaration of submitters
@@ -143,6 +165,13 @@ trait GoVerifier extends StrictLogging { | |||
if (allErrors.isEmpty) VerifierResult.Success else VerifierResult.Failure(allErrors) | |||
} | |||
|
|||
private def createSubmitter(allowSubmission: Boolean, id: String, verifier: String): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make the signature of createSubmitter
by having verifier
of type ViperBackend
. We could obtain a the name using the name
field that I suggested.
s.setSuccess(result == VerifierResult.Success) | ||
s.submit()} | ||
) | ||
submitters = submitters.removed(pkgId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing this here?
@@ -143,6 +165,13 @@ trait GoVerifier extends StrictLogging { | |||
if (allErrors.isEmpty) VerifierResult.Success else VerifierResult.Failure(allErrors) | |||
} | |||
|
|||
private def createSubmitter(allowSubmission: Boolean, id: String, verifier: String): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a better name would be registerSubmitter
@@ -143,6 +165,13 @@ trait GoVerifier extends StrictLogging { | |||
if (allErrors.isEmpty) VerifierResult.Success else VerifierResult.Failure(allErrors) | |||
} | |||
|
|||
private def createSubmitter(allowSubmission: Boolean, id: String, verifier: String): Unit = { | |||
if (allowSubmission) { | |||
val submitter = new ManualProgramSubmitter(true, "", "Gobra", verifier, Array()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we actually submitting anything if the second parameter is always ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I find it a bit odd that we have a flag ProgramSubmitter
has a field allowSubmission
. Maybe I misunderstand its purpose, but if this object was registered, it should be submitted. Otherwise, we should not register it. I don't see the need for this field.
@Dspil is this still relevant, or shall I close it? |
It is, just not very high in my todo list. |
This PR contains changes to facilitate submissions to the Viper data collection server.
submitForEvaluation
flag to the configGoVerifier